package admin.controller;


import admin.entity.Checkgroup;
import admin.util.PageQuery;
import admin.common.Result;
import admin.service.CheckgroupService;
import admin.util.PageResult;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author wjd
 * @since 2024-11-21
 */
@RestController
@RequestMapping("/checkgroup")
public class CheckgroupController {

    @Resource
    private CheckgroupService checkgroupService;

    @RequestMapping("/findPageInfo")
    public PageResult findPageInfo(@RequestBody PageQuery pageQuery){
        PageResult pageResult = checkgroupService.findPageInfo(pageQuery);
        return pageResult;
    }

    //添加检查组信息
    @RequestMapping("/saveGroupInfo")
    public Result saveGroupInfo(Integer[] ids, @RequestBody Checkgroup checkgroup){
        Result result = checkgroupService.saveGroupInfo(ids,checkgroup);
        return result;
    }

    //默认勾选
    @RequestMapping("/getCheckitemids")
    public Result getCheckitemids(Integer id){
        Result result = checkgroupService.getCheckitemids(id);
        return result;
    }

    @RequestMapping("/updateGroupInfo")
    public Result updateGroupInfo(Integer[] ids,@RequestBody Checkgroup checkgroup){
        Result result = checkgroupService.updateGroupInfo(ids,checkgroup);
        return result;
    }

    @RequestMapping("/deleteInfoById")
    public Result deleteInfoById(Integer id){
        Result result = checkgroupService.deleteInfoById(id);
        return result;
    }
}

